from django import forms
from .models import Poet

class PoetForm(forms.Form):
    name = forms.CharField(max_length=5)
    sex = forms.ChoiceField(choices=((1,'hanzi'),(2,'女')))
    dynasty = forms.ChoiceField(choices=((1,'唐'),(2,'宋'),(3,'元'),(4,'清')))

class PoetModelForm(forms.ModelForm):
    class Meta:
        model = Poet
        fields = ['sex', 'name', 'dynasty']